2020-2021 Sunseeker Telemetry and Lighting System
eusci_b_i2c_ex3_masterTxMultiple.c File Reference
#include "driverlib.h"
#include "Board.h"

Go to the source code of this file.

Macros

#define SLAVE_ADDRESS   0x48
 
#define CS_SMCLK_DESIRED_FREQUENCY_IN_KHZ   1000
 
#define CS_SMCLK_FLLREF_RATIO   30
 

Functions

void main (void)
 
void USCIB0_ISR (void)
 

Variables

uint8_t TXData = 0
 
uint8_t TXByteCtr
 

Macro Definition Documentation

◆ CS_SMCLK_DESIRED_FREQUENCY_IN_KHZ

#define CS_SMCLK_DESIRED_FREQUENCY_IN_KHZ   1000

Definition at line 90 of file eusci_b_i2c_ex3_masterTxMultiple.c.

◆ CS_SMCLK_FLLREF_RATIO

#define CS_SMCLK_FLLREF_RATIO   30

Definition at line 97 of file eusci_b_i2c_ex3_masterTxMultiple.c.

◆ SLAVE_ADDRESS

#define SLAVE_ADDRESS   0x48

This example shows how to configure the I2C module as a master for multi byte transmission in interrupt driven mode. The address of the slave module is set in this example.

Demo - EUSCI_B0 I2C Master TX multiple bytes to MSP430 Slave

Description: This demo connects two MSP430's via the I2C bus. The master transmits to the slave. This is the MASTER CODE. It cntinuously transmits an array of data and demonstrates how to implement an I2C master transmitter sending multiple bytes using the USCI_B0 TX interrupt. ACLK = n/a, MCLK = SMCLK = BRCLK = default DCO = ~1MHz

                          /|\  /|\
    MSP430FR2xx_4xx Board 10k  10k MSP430FR2xx_4xx Board
             slave         |    |         master
       -----------------   |    |   -----------------
      |          UCB0SDA|<-|----+->|UCB0SDA          |
      |                 |  |       |                 |
      |                 |  |       |                 |
      |          UCB0SCL|<-+------>|UCB0SCL          |
      |                 |          |                 |

This example uses the following peripherals and I/O signals. You must review these and change as needed for your own board:

  • I2C peripheral
  • GPIO Port peripheral (for I2C pins)
  • SCL
  • SDA

This example uses the following interrupt handlers. To use this example in your own application you must add these interrupt handlers to your vector table.

  • USCI_B0_VECTOR.

Definition at line 83 of file eusci_b_i2c_ex3_masterTxMultiple.c.

Function Documentation

◆ main()

◆ USCIB0_ISR()

void USCIB0_ISR ( void  )

Variable Documentation

◆ TXByteCtr

uint8_t TXByteCtr

Definition at line 101 of file eusci_b_i2c_ex3_masterTxMultiple.c.

◆ TXData

uint8_t TXData = 0

Definition at line 100 of file eusci_b_i2c_ex3_masterTxMultiple.c.